// TOWN DIALOGUE SCRIPT
//    Town 105: Lair of Khoth

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 1;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "The stone sentinel stares at you, but it doesn't respond. It is a mindless construct, put here to protect and aid Khoth.";

// Khoth

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Khoth";
	text1 = "You encounter Khoth, the most learned and secretive member of dragonkind. He is reading a scroll, carefully holding it in his claws. You think he is pretending not to see you. Then you realize that he really hasn't noticed you.";
	text2 = "You clear your throat. He finally looks up at you and sets the scroll aside. His voice is raspy and laced with contempt. _I am Khoth, intruder. Say your business, so I can return to my studies._";
	text5 = "Khoth watches you carefully. He has seen so many like you, and will see many more. He constantly uses his centuries of experience to rebalance how much information he can gain from you and how much he should give in return.";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = 2;
	condition = gf(105,11) == 0;
	question = "_Greetings, dragon. May I speak with you?_";
	text1 = "_If you must. I prefer to spend my time studying and learning. And the rest of the time, I meditate on my hatred of humans._";
	text2 = "_However, Sulfras has convinced me that I should speak with and assist you. So I will give you a small measure of my time._";
	action = SET_SDF 105 11 1;

begintalknode;
	state = 2;
	nextstate = 3;
	question = "_Why do you hate humans?_";
	text1 = "_Most of humankind are insects to me. I only despise the clump of petty monkeys that calls itself the Empire. But this is all irrelevant. Sulfras has convinced me I must assist you in other matters, by sharing some of my knowledge with you._";

begintalknode;
	state = 1;
	nextstate = 3;
	condition = gf(105,11) > 0;
	question = "_What are you studying?_";
	text1 = "Khoth snorts a tiny, contemptuous puff of flame. _I know of worlds you cannot contemplate and facts of the mundane world so bizarre you cannot imagine. I can speak tongues lost to our world. A hundred human minds could not encompass all that I have forgotten._";
	text2 = "_Sulfras has convinced me, however, that a little of this should be shared with you. This will give us advantage in dealing with the foul Empire._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_What did the Empire do to you?_";
	text1 = "His eyes flash with fury. He inhales deeply. You prepare for the burst of flame, but, fortunately, it doesn't come. He calms down, and says, _I choose not to speak of it._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_What will you share with us?_";
	text1 = "_Well, you may purchase a few spells from me. I am always eager to add to my trove. What is more, Sulfras wants me to help you with this alien beast problem._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Is your trove great?_";
	text1 = "He snorts a gout of fire. _Only a fool asks a dragon of his trove._";

begintalknode;
	state = 4;
	nextstate = 5;
	question = "_Tell me more of the alien beasts._";
	text1 = "_The humans are set upon from all sides by sinister monsters. We approve of this. It fills dragonkind with joy. However, one of these types of creatures, the alien beasts, brings me and my siblings much inconvenience._";

begintalknode;
	state = 5;
	nextstate = 6;
	question = "_Who are your siblings?_";
	text1 = "_Athron and Sulfras are my siblings._";

begintalknode;
	state = 6;
	nextstate = 4;
	question = "_What do you think of them?_";
	text1 = "_Athron is lost in the fuzzy-headed joys of the brood. Sulfras is focused and powerful. And that is all you are allowed to know._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Tell me about the alien beasts._";
	text1 = "_They are muscular, vicious, and powerful, unlike any creature I have ever learned of. They scourged the rich Empire lands to the north. Then the Empire walled off the land, holding them in._";

begintalknode;
	state = 5;
	nextstate = -1;
	question = "_Do you know who created these creatures?_";
	text1 = "_I do not. Even my knowledge, for the moment, has limits. It was a remarkable work of magic._";
	
begintalknode;
	state = 5;
	nextstate = 7;
	question = "_What inconveniences have the beasts caused you?_";
	text1 = "_The alien beasts can be killed by us, but only with difficulty and not before they do serious damage. We know humans battle these monsters, and believe, with help, you can make the beast problem decrease._";
	text2 = "_That is why there is a ritual Sulfras wishes me to teach you._";

begintalknode;
	state = 7;
	nextstate = -1;
	question = "_What is the ritual?_";
	text1 = "_Search my bookshelves. You will find what you need eventually. I have a tome which will teach you how to make a weapon to slay alien beasts, the culmination of months of thorough research on my part._";
	text2 = "_Now go. I wish to waste no more time on mere humans._";
	action = END_TALK;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(105,11) > 0;
	question = "_I would like to buy spells from you._";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Khoth's Spells","Khoth only teaches the most powerful magical spells. All others are beneath him. His prices, however, match the power of his knowledge.",100,6,3);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(105,11) > 0;
	question = "_Can you train me? I would like to purchase some of your knowledge._";
	text1 = "_I can teach magic. The rest of my knowledge is too valuable to share for mere money._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(309,1) >= 1;
	question = "_I have found evidence that you dragons are responsible for the monster plagues._";
	text1 = "Khoth chuckles. _Oh, have you? Well, if we were going to strike out at the Empire, we would do more than this. Our blow would be much more decisive, and aimed at the highest levels._";
	text2 = "_Do not bother me with such trivia and rumor-mongering._";

begintalknode;
	state = 1;
	nextstate = 12;
	condition = gf(105,11) > 0;
	question = "_I believe the dragons are the enemies of humanity._";
	text1 = "Now you have gotten Khoth's attention. He snorts out a cloud of sulfurous smoke. With an audible grinding of stone, the golems by the west wall turn to look at you.";
	text2 = "_I am the foe of the Empire. They hunted us dragons. Killed most of us. Sent the rest into exile in the underworld. We will let humans live, once the Empire is destroyed._";
	text3 = "_You have forgotten your humility. It's time for you to go._";
	
begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Sorry. I'll be going, then._";
	text1 = "_You do that. Return when you've found your manners._";
	action = END_TALK;
	
begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_I think we're all safer without you._ Attack.";
	text1 = "Khoth rises up and roars. He is a scholar, but he is no weakling. He looms over you, tons of muscle and claw. As he approaches, his stone sentinels walk away from the walls.";
	action = END_TALK;
	code =
		set_attitude(10508,10);
		set_attitude(10519,10);
		set_attitude(10524,10);

		set_attitude(10516,10);
		set_attitude(10515,10);
		set_attitude(10503,10);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(105,11) > 0;
	question = "_That is all I have to say._";
	text1 = "Khoth nods. He returns to his studies without another word.";
	action = END_TALK;

